# -*- coding: utf_8 -*-  

import modbus_tk  
import modbus_tk.defines as cst  
import modbus_tk.modbus_rtu as modbus_rtu
import serial
import time
import logging 
logger = modbus_tk.utils.create_logger("console") 
if __name__ == '__main__':
	print('this is a dev branch')
	try:
		master	=	modbus_rtu.RtuMaster(serial.Serial("com3",9600))
		master.set_timeout(6.0)
		#read寄存器
		logger.info(master.execute(1, cst.READ_HOLDING_REGISTERS,0, 16))
		 
	except:
		logger.error("error") 
		

